//
//  UIFactory.m
//  yunqiphone
//
//  Created by Maple on 13-7-8.
//  Copyright (c) 2013年 ci123.com. All rights reserved.
//

#import "UIFactory.h"

@implementation UIFactory

+ (UIBarButtonItem *)createBarButtonItem:(NSString *)title
                                  target:(id)target
                                  action:(SEL)action{
  UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 50, 30)];
  button.titleLabel.font = [UIFont systemFontOfSize:14.0f];
  [button setTitle:title forState:UIControlStateNormal];
  button.showsTouchWhenHighlighted = YES;
  [button setBackgroundImage:[UIImage imageNamed:@"pub"] forState:UIControlStateNormal];
  [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
  UIBarButtonItem *pub = [[UIBarButtonItem alloc] initWithCustomView:button];
  return pub;
}
@end
